package org.clzps.filetransfer;

import java.io.IOException;
import java.io.InputStream;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.clzps.filetransfer.ftp.FtpBackInfo;
import org.clzps.filetransfer.http.HttpFileInfo;

public abstract class FileTransferHelper {
	protected final Logger logger = Logger.getLogger(getClass());
	
	private void printLogWarn(String msg) {
		logger.warn("You're Calling the Method: " + msg + " of Abstract/Super Class!");
	}
	
	/******************************************************************
	 * 以下为FTP方式进行文件的传输
	 *****************************************************************/
	public FtpBackInfo uploadFile(String type, String storePath, String storeFileName, String suffix, InputStream in) {
		printLogWarn("uploadFile(String, String, String, InputStream)");
		return null;
	}
	
	public boolean downloadFile(String type, String path, String filename, String destDir) {
		printLogWarn("downloadFile(String, String, String, String)");
		return false;
	}
	
	/******************************************************************
	 * 以下为HTTP方式进行文件的传输
	 *****************************************************************/
	public HttpFileInfo uploadFile(HttpServletRequest request, String uploadPath)
		throws ServletException, IOException {
		printLogWarn("uploadFile(HttpServletRequest, String)");
		return null;
	}
	
	
}
